<template>
	<view class="set-list wrap">
		<view class="set-item" v-for="(item,index) in setList" :key="index" @tap="fn(item.fn)">
			<text>{{item.text}}</text>
			<image  :src="item.rightIcon" mode="widthFix"></image>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				setList: [
					{
						text: '退出登录',
						rightIcon: '../../static/icons/right_arrow.png',
						fn: 'clearStore'
					}
				]
			}
		},
		methods: {
			fn: function(isFN) {
				let _self = this;
					this[isFN]();
			},
			clearStore: function(){
				uni.showModal({
					title: '退出登录',
					content: '你确定要退出登录吗？',
					complete() {
						uni.removeStorageSync('wxAvatar');
						uni.removeStorageSync('wxNickName');
					},
					success() {
						uni.showToast({
							title: '已退出登录',
							icon: 'none'
						})
					}
				});
				
			}
		}
	}
</script>

<style>
	.set-item{
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20upx 0;
		border-bottom: 1px solid #eee;
	}
	.set-item text{
		font-size: 30upx;
	}
	.set-item image{
		display: block;
		width: 40upx;
	}
</style>
